package reflect;


import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class ReflectDemo3 {
    public static void main(String[] args) throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException {
     person pa = new person("李四",55);
        System.out.println(pa);

        Class cas = Class.forName("reflect.person");


        Constructor c = cas.getConstructor(String.class , int.class);
        Object obj = c.newInstance("王五",44);
        System.out.println(obj);




    }
}
